package com.sy.creation.builder;

public class Test {

    public static void main(String[] args) {

        // 正常调用
//        XiaoMiBuilder xiaoMiBuilder = new XiaoMiBuilder();
//        xiaoMiBuilder.initCpu("晓龙");
//        xiaoMiBuilder.initDisk("1T");
//        xiaoMiBuilder.initMen("4g");
//        Phone phone = xiaoMiBuilder.getPhone();
//        System.out.println(phone);

        // 链式调用
        XiaoMiBuilder xiaoMiBuilder = new XiaoMiBuilder();
        Phone phone = xiaoMiBuilder.initCpu("晓龙").initDisk("1T").initMen("4g").getPhone();
        System.out.println(phone);
    }
}
